package flexo.math;

public class Coords
{
	public float x,y;
	
	public Coords(Coords c)
	{
		this.x = c.x;
		this.y = c.y;
	}
	
	public Coords(float x, float y)
	{
		this.x = x;
		this.y = y;
	}
	
	public Coords()
	{
		x = 0;
		y = 0;
	}
	
	public void clamp(float minValue, float maxValue)
	{
		if (x < minValue)
		{
			x = minValue;
		}
		else if (x > maxValue)
		{
			x = maxValue;
		}
		
		if (y < minValue)
		{
			y = minValue;
		}
		else if (y > maxValue)
		{
			y = maxValue;
		}
	}
	
	public String toString()
	{
		return "x: " + String.valueOf(x) + ", y: " + String.valueOf(y);
	}
}
